#ifndef _Date_H_
#define _Date_H_

#include<iostream>

int totaldays[2][12]={ {31,28,31,30,31,30,31,31,30,31,30,31}, {31,29,31,30,31,30,31,31,30,31,30,31} };

class date{
	private:
		int year, month, day;

	public:
		date(): year(0), month(0), day(0){}
		date(const int y, const int m, const int d): year(y), month(m), day(d){}

		int is_run()
		{
			if(year%400 == 0 || (year % 4 == 0 && year % 100 != 0))
				return 1;
			return 0;
		}

		date next()
		{
			date temp(year, month, day);
			temp.day++;
			if(day > totaldays[temp.is_run()][month])
			{
				day = 1;
				month++;
			}
			if(month > 12)
			{
				month = 1;
				year++;
			}

			return temp;
		}

		void print()
		{
			std::cout << "Year :" << year << " Month:" << month << " Day:" << day << std::endl;
			return ;
		}
};

#endif
